﻿@model Mobile_new.Models.MainViewModel
@{
    var IspicChecked = "checked=checked";
    if (Model.Website.IsPictureGallery == false)
    {
        IspicChecked = "";
    }
    var isContactUs = "checked=checked";
    if (Model.Website.IsContactusPage == false)
    {
        isContactUs = "";
    }
}
@Html.HiddenFor(model => model.MyTheme.theme_id)
<script src="@Url.Content("~/Scripts/MicrosoftAjax.js")" type="text/javascript"></script>
<script type="text/javascript">

    function deleteRecord(recordId) {
        // Perform delete
        var answer = confirm("Are you sure want to delete this page?");

        if (answer) {
            var action = "/AdminPages/Delete/" + recordId;

            var request = new Sys.Net.WebRequest();
            request.set_httpVerb("DELETE");
            request.set_url(action);

            request.add_completed(deleteCompleted);
            request.invoke();
        }
    }

    function deleteCompleted() {
        // Reload page
        window.location.reload();
    }</script>
<style type="text/css">
    #pattern-style-a
    {
        font-family: "Lucida Sans Unicode" , "Lucida Grande" , Sans-Serif;
        font-size: 12px;
        width: 100%;
        position: relative;
        text-align: left;
        margin: 20px 0px;
        border-radius: 10px;
    }
    #pattern-style-a thead tr
    {
    }
    #pattern-style-a th
    {
        font-size: 13px;
        font-weight: normal;
        border-bottom: 1px solid #fff;
        color: #039;
        padding: 8px;
    }
    #pattern-style-a td
    {
        color: #669;
        border-top: 1px solid transparent;
    }
    
    #td
    {
        padding: 8px;
    }
</style>
<style type="text/css">

/* Let's get this party started */
::-webkit-scrollbar {
    width: 5px;
}
 
/* Track */
::-webkit-scrollbar-track {
    -webkit-box-shadow: inset 0 0 6px rgba(0,0,0,0.3); 
    -webkit-border-radius: 10px;
    border-radius: 10px;
}
 
/* Handle */
::-webkit-scrollbar-thumb {
    -webkit-border-radius: 10px;
    border-radius: 10px;
    background: rgba(0,0,0,0.8); 
    -webkit-box-shadow: inset 0 0 6px rgba(0,0,0,0.5); 
}
::-webkit-scrollbar-thumb:window-inactive {
	background: rgba(0,0,0,0.4); 
}
.pages td
{
 border-bottom:1px solid #fff;
 background-color:#0098fe;
}
.pages a,h5
{
    font-size:14px;
    color:#fff;
    font-weight:600;
}
.pages a:hover
{
  text-decoration:underline;
  color:#000;
}
    #PageContainer
    {
       background-color: @Model.MyTheme.backgroundColor;
   background-image:url('@Url.Content("~/uploads/" + Model.MyTheme.backgroundImage)');
        border: 1px solid #fff;        
        margin: 0px;
        padding: 0px;
        width: 230px;
        margin-left:-50px;
    
       position:relative;
    }
    #PageContainer span
    {
        line-height: 20px;
        letter-spacing: 1px;
        margin-top: 15px;
    }
    #header
    {
         background-color: @Model.MyTheme.Headercolor;
        height: 40px;
        vertical-align:top;  
        margin-top:-15px;
        
       


     
    
      
      
     
      
        color: white;
        background-image: url('@Url.Content("~/uploads/" + Model.MyTheme.HeaderImage)');
        text-align: center;
    }
    .footer
    {
        height: 40px;
        text-align: center;
           vertical-align:bottom;
        color: white;
        margin-top:7px;
    
      
        
        background-color: Black;
    }
    ul.metroui-list1
    {
        list-style: none;
        padding: 0;
        margin: 3;
    }
    #content1
    {
     width:225px;
height:215px;
overflow-y: scroll;
    }
ul.metroui-list1 li { 

width:110px;
	margin-top: 2px;
	margin-bottom: 2px;
	background-color: #350505;
	color: #fff;
	cursor: pointer;
	text-decoration:none;
	text-align:center;
	color:#fff;
	font-size:18px;
			border-radius:3px;
}
a,a:active,a:visited
{
	text-decoration:none;
	color:#FFF;
}

ul.metroui-list1 li:hover {
	background-color: #BCA4A4;
    color:#FFF;
}

li.metroui-list1-selected {
	background-color:#4e534b !important;
	color: #fff;
}
</style>
<script type="text/javascript">

    $(document).ready(function () {

            $("#ContactUS").css("display", "none");


        if ($("#myPictureGallery").is(':checked') == false) {
            $("#ManagePictures").css("display", "none");
            $("#PictureGallery").css("display", "none");
            $(".pages").trigger('Create');
        }

        $("#myPictureGallery").change(function () {
            if ($("#myPictureGallery").is(':checked')) {
                $("#ManagePictures").css("display", "block");
                $("#PictureGallery").css("display", "block");
                $("#ManagePictures").show().slideDown("slow");
                $(".pages").trigger('Create');
            }
            else if ($("#myPictureGallery").is(':checked') == false) {
                $("#ManagePictures").css("display", "none");
                $("#PictureGallery").css("display", "none");
                $(".pages").trigger('Create');
            }
        });
        // $("#Website_IsPictureGallery").toggleClass("on");
        $("#myContactUs").change(function () {
            if ($("#myContactUs").is(':checked')) {

                $.get('/AdminPages/AddContactUS/56', function (data) {

                    $("#ContactUS").css("display", "block");
                    $(".pages").trigger('Create');
                    alert("Contact us Pages added succcessfully");
                    window.location.href = window.location.href;

                });

            }
            else if ($("#myContactUs").is(':checked') == false) {

                var answer = confirm("Are you sure want to delete this page?");

                if (answer) {
                    var action = "/AdminPages/DeleteContactUs/@Mobile_new.MvcApplication.pageId";

                    var request = new Sys.Net.WebRequest();
                    request.set_httpVerb("DELETE");
                    request.set_url(action);
                    request.add_completed(deleteCompleted);
                    request.invoke();
                    $("#ContactUS").css("display", "none");
                    $(".page").trigger('Create');
                }

                //  alert("Contact us Pages removed succcessfully");
            }

        });
    });
</script>
<table id="pattern-style-a">
    <tr>
        <td colspan="3">
            <table border="0" width="100%" cellpadding="0" cellspacing="0">
                <tr>
                    <td id="td">@Html.Label("Website Url")
                        <input id="Website_web_url" class="" name="Website_web_url" type="text" value="@Model.Website.web_url" />
                        @Html.Label(".MWG.com")
                    </td>
                    <td id="td">
                        <div class="editor-label">
                            <div class="editor-label">
                                @Html.LabelFor(model => model.Website.IsPictureGallery)
                                <input  data-val="true" data-val-required="The IsPictureGallery field is required." @IspicChecked id="myPictureGallery" name="myPictureGallery" type="checkbox" value="@Model.Website.IsPictureGallery" />
                                @* <input name="Website.IsPictureGallery" type="hidden" value="@Model.Website.IsPictureGallery" />*@
                            </div>
                        </div>
                    </td>
                    <td id="td">
                        <div class="editor-label">
                            @Html.LabelFor(model => model.Website.IsContactusPage)
                            <input data-val="true" data-val-required="The IsContactusPage field is required." @isContactUs id="myContactUs" name="myContactUs" type="checkbox" value="@Model.Website.IsContactusPage" />
                            @*  <input name="Website.IsContactusPage" type="hidden" value="@Model.Website.IsContactusPage" />*@
                        </div>
                        <div class="editor-field">
                        </div>
                    </td>
                </tr>
            </table>
        </td>
    </tr>
    <tr>
        <td style="margin-top: -200px;" id="td">
            <table style="vertical-align: top;" id="simple" width="100%" class="pages" cellpadding="3"
                cellspacing="3">
                <tr style="background-color: #333;">
                    <th>
                        <h5>
                            Pages
                        </h5>
                    </th>
                    <th>
                        <h5>
                            Action
                        </h5>
                    </th>
                </tr>
                @foreach (var item in Model.ContentPages)
                {
                    if (item.title != "PictureGallery")
                    {
                    
                    <tr>
                        <td id="td">
                            <a href="@Url.Action("Edit", "AdminPages", new { id = item.page_id })">@item.title</a>
                        </td>
                        <td id="td">
                            <a onclick="deleteRecord(@item.page_id)" href="JavaScript:void(0)">Delete</a>
                        </td>
                    </tr>
                    }
                }
                <tr>
                    <td id="td" colspan="3">
                        <a href="@Url.Action("Create", "AdminPages")" style="color:Red">Add New Page</a>
                    </td>
                </tr>
            </table>
        </td>
        <td>
            @*<table style="margin-left: 80px;" width="262" border="0" cellpadding="0" cellspacing="0">
                <tr>
                    <td colspan="3">
                        <img src="@Url.Content("~/Images/Untitled-1_01.gif")" width="262" height="90" alt="">
                    </td>
                    <td>
                        <img src="@Url.Content("~/Images/spacer.gif")" width="1" height="90" alt="">
                    </td>
                </tr>
                <tr>
                    <td>
                        <img src="@Url.Content("~/Images/Untitled-1_02.gif")" style="margin-top:-12px;" width="12" height="310" alt="">
                    </td>
                    <td>
                        <div id="PageContainer">
                            <div style="top: 0px; width: auto; position: static;" id="header">
                                <h4>@Model.MyTheme.HeaderText</h4>
                            </div>
                            <div id="content1">
                                @Html.Partial("_Pages", Model)
                            </div>
                            <div class="footer">
                                <h4>
                                    @Model.MyTheme.Footertext</h4>
                            </div>
                        </div>
                    </td>
                    <td rowspan="2">
                        <img src="@Url.Content("~/Images/Untitled-1_04.gif")" style="margin-top:-52px;margin-left:-150px;" width="12"  "  height="347" alt="">
                    </td>
                    <td>
                        <img src="@Url.Content("~/Images/spacer.gif")" width="1" height="310" alt="">
                    </td>
                </tr>
                <tr>
                    <td colspan="2" rowspan="2">
                        <img src="@Url.Content("~/Images/Untitled-1_05.gif")" style="margin-top:-24px;" width="250" height="123" alt="">
                    </td>
                    <td>
                        <img src="@Url.Content("~/Images/spacer.gif")" width="1" height="37" alt="">
                    </td>
                </tr>
                <tr>
                    <td>
                        <img src="@Url.Content("~/Images/Untitled-1_06.gif")" style="margin-top:-52px;margin-left:-150px;" width="12" height="86" alt="">
                    </td>
                    <td>
                        <img src="@Url.Content("~/Images/spacer.gif")" width="1" height="86" alt="">
                    </td>
                </tr>
            </table>*@
            <table style="margin-left: 80px;" width="262" border="0" cellpadding="0" cellspacing="0">
                <tr>
                    <td colspan="3">
                        <img style=" margin-bottom:-16px;" src="@Url.Content("~/Images/Untitled-1_01.gif")" width="262" height="90" alt=""/>
                    </td>
                    <td>
                        <img src="@Url.Content("~/Images/spacer.gif")" width="1" height="90" alt=""/>
                    </td>
                </tr>
                <tr>
                    <td>
                        <img src="@Url.Content("~/Images/Untitled-1_02.gif")" style="margin-top:-12px;" width="12" height="380" alt=""/>
                    </td>
                    <td>
                        <div id="PageContainer">
                            <div style="top: 0px; width: auto; position: static;" id="header">
                                <h4>@Model.MyTheme.HeaderText</h4>
                            </div>
                            <div id="content1">
                                @Html.Partial("_Pages", Model)
                            </div>
                            <div class="footer">
                                <h4>
                                    @Model.MyTheme.Footertext</h4>
                            </div>
                        </div>
                    </td>
                    <td rowspan="2">
                        <img src="@Url.Content("~/Images/Untitled-1_04.gif")" style="margin-top:-12px; height:430px; margin-left:-171px;" width="12" height="347" alt="">
                    </td>
                    <td>
                        <img src="@Url.Content("~/Images/spacer.gif")" width="1" height="310" alt="">
                    </td>
                </tr>
                <tr>
                    <td colspan="2" rowspan="2">
                        <img src="@Url.Content("~/Images/Untitled-1_05.gif")" style="margin-top:-88px;" width="250" height="123" alt="">
                    </td>
                    <td>
                        <img src="@Url.Content("~/Images/spacer.gif")" width="1" height="37" alt="">
                    </td>
                </tr>
                <tr>
                    <td>
                        <img src="@Url.Content("~/Images/Untitled-1_06.gif")" style="margin-top:-225px; margin-bottom:15px; margin-left:-171px;" width="12" height="86" alt="">
                    </td>
                    <td>
                        <img src="@Url.Content("~/Images/spacer.gif")" width="1" height="86" alt="">
                    </td>
                </tr>
            </table>
        </td>
        <td id="">
            <ul class="metroui-list1">
                <li><a href="@Url.Action("ChangeSetting", "ThemeDetails", new { id = Model.MyTheme.theme_id })">
                    Change Setting</a></li>
                <li id="ManagePictures"><a href="@Url.Action("index", "AdminPictureGallery")" >Manage
                    Pictures</a></li>
            </ul>
        </td>
    </tr>
    <tr>
        <td colspan="3">
            <input class="form_submit" type="submit" value="Update" />
        </td>
    </tr>
</table>
